This invention relates generally to image processing, and more particularly to a hardware system and method for rotating an image.
Computer systems store images in a bitmap format. Bitmaps are organized so that a display controller can read a sequence of bits corresponding to a picture element (pixel) and transfer the sequence to a display for pixel rendition. The display controller repeats this process for successive pixels until an entire image is displayed.
Organization of a bitmap defines image dimensions and image orientation, i.e., portrait or landscape. An image is portrait-oriented if its height is greater than its width, and landscape-oriented if its width is greater than its height. FIG. 1(a) depicts a landscape-oriented image bitmap. The width (W.sub.I) of the image is greater than its height (H.sub.I). FIG. 2(a) depicts a portrait-oriented image bitmap. H.sub.I is greater than W.sub.I. The arrows in both corresponding FIGS. 1(a) and 2(a) illustrate software addressing patterns in which pixels values are typically stored to bitmap storage.
To maximize the duty cycle of the display, i.e. to minimize the period of time between successive refresh cycles of a given scan line, display devices such as Cathode Ray Tubes (CRTS) or Liquid Crystal Displays (LCDs) are typically landscape-configured. That is, display devices have physical address schemes which cause pixels to be refreshed in a landscape-oriented pattern. As can be seen by the arrows in FIG. 1(b), the typical landscape-oriented display's refresh operation starts at the top left comer and continues rightward across the first row and downward through the rows.
For some computer systems or applications, it is desirable to have a portrait-oriented display. In such a system, the CRT or LCD would be physically rotated ninety degrees. The arrows in FIG. 2(b) illustrate that, for the physically rotated display, the refresh address scheme is still landscape-oriented: it begins at the original pixel location (rotated ninety degrees counter-clockwise to the bottom left comer now) and continues in the same order.
The software addressing pattern depicted in FIG. 1(a) is the same as the physical address pattern depicted in FIG. 1(b), so landscape-oriented software addresses to landscape-oriented physical addresses do not need to be translated. However, the software addressing pattern depicted in FIG. 2(a) is not the same as the physical address pattern depicted in FIG. 2(b). Thus, portrait-oriented image addresses need translation to a physical address for a portrait-oriented landscape-configured display.
Existing display systems rotate an image ninety degrees by using a program or a special driver to translate software addresses to physical addresses. When the typical rotation program is instructed to draw a bitmap sequence, the program first performs software translation operations to determine new pixel coordinates when rotated 90.degree., and then performs the drawing operation using those translated coordinates. In some particular drawing operations, additional software may be necessary to treat the rotated drawing as a "special case." For example, to draw text characters in a rotated graphics display would require retrieving the bitmapped font pixels from font storage in a rotated orientation rather than the normal byte-wise unrotated orientation in which the font data is stored. This may require several additional memory cycles to retrieve this rotated bit-mapped font data for just a single line of a given character. In general, the large number of additional read and translation operations for any drawing operation to rotate an image consumes substantial computer processing resources and time. These problems are compounded when larger or more-complex images are rotated.
Additional complexity can arise when the input signal has come to represent a mirrored version of the intended image. This can occur in the situations in which, say, a video camera in a videoconferencing environment is oriented in a normal, horizontal orientation to view human participants but is also provided with a mirror to deflect the field of view downward onto a document. Some systems deal with this reversal by employing video cameras that can reverse their scans. However, this option imposes a significant cost penalty.